
<% provide(:title, @document.name) %>
<div id="content_title"><%= @document.name %></div>
<hr noshade size="1">

<p>
	<%= link_to 'Edit', edit_document_path(@document), action: :edit%>
	<%= button_to 'Delete', @document, method: :delete, confirm: 'Are you sure?' %>
</p>
<p>
	<%= t('activerecord.models.category', count: 2) %> 
	<ul>
	<% @document.categories.each do |category| %>
		<li><%= link_to category.name, category  %> </li>
	<% end %>
	</ul>
</p>
<p>
    <%= t('activerecord.attributes.document.files') %>
    <ul>
    <% @document.files.each do |file| %>
        <%= link_to File.basename(file.path), "/#{file.path}" %><br>
    <% end %>
    </ul>
</p>
<p>
	<%= t('activerecord.attributes.document.description') %>:
	<%= simple_format(@document.description) %>
</p>
<p>
	<%= t('activerecord.attributes.document.authors') %>: 
	<%= @document.authors %>
</p>
<p>
	<%= t('activerecord.attributes.created_at') %>: 
	<%= l(@document.created_at, format: :long) %>
</p>
<p>
	<%= t('activerecord.attributes.created_by') %>: 
	<%= id_to_user_link(@document.created_by) %>
</p>
<p>
	<%= t('activerecord.attributes.updated_at') %>: 
	<%= l(@document.updated_at, format: :long) %>
</p>
<p>
	<%= t('activerecord.attributes.updated_by') %>: 
	<%= id_to_user_link(@document.updated_by) %>
</p>
<p>
	<%= t('activerecord.attributes.document.publication_date') %>: 
	<%= l(@document.publication_date) unless @document.publication_date.blank? %>
</p>
<p>
	<%= t('activerecord.attributes.document.related_work') %>: 
	<%= @document.related_work %>
</p>
<p>
	<%= t('activerecord.attributes.document.tags') %>: 
	<%= @document.tags.map { |t| link_to t.name, t }.join(', ').html_safe %>
</p>

<h2><%= t('activerecord.models.comment', count: 2) %></h2>
<%= render 'comments/new' %>
<%= render 'comments/index', comments: @comments %>